<?php
/* [$WindsForce] (C)Hunzhiwange.COM Since 2014.07.14.
   家居公司设计作品列表($$)*/

!defined('Q_PATH') && exit;

class Case_C_Controller extends InitController{

	public function index(){
		$arrJiajucompany=$this->_oParent->_arrJiajucompany;
		
		if(ACTION_NAME==='room'){
			Core_Extend::getSeo($this,array(
				'title'=>"{$arrJiajucompany['jiajucompany_fullname']}样板房",
				'keywords'=>"{$arrJiajucompany['jiajucompany_fullname']}样板房",
				'description'=>"通过{$GLOBALS['_option_']['site_name']}您可以及时准确的了解{$arrJiajucompany['jiajucompany_fullname']}的最新样板房，让你更好地选择装修公司。",
			));
		}else{
			Core_Extend::getSeo($this,array(
				'title'=>"{$arrJiajucompany['jiajucompany_fullname']}装修案例 - {$arrJiajucompany['jiajucompany_fullname']}设计作品精选 - {$arrJiajucompany['jiajucompany_fullname']}家居图片分享",
				'keywords'=>"{$arrJiajucompany['jiajucompany_fullname']}装修案例,{$arrJiajucompany['jiajucompany_fullname']}设计作品精选,{$arrJiajucompany['jiajucompany_fullname']}家居图片分享,{$GLOBALS['_option_']['site_name']}家居图片分享",
				'description'=>"通过{$GLOBALS['_option_']['site_name']}您可以及时准确的了解{$arrJiajucompany['jiajucompany_fullname']}的最新装修案例、设计作品精选、家居图片分享等。",
			));
		}

		// 作品列表
		$arrWhere=array();
		$arrWhere['jiajucase_status']=1;
		$arrWhere['jiajucompany_id']=$arrJiajucompany['jiajucompany_id'];

		if(ACTION_NAME==='room'){
			$arrWhere['jiajucase_ismodel']=1;
		}

		$nTotal=Model::F_('jiajucase')->where($arrWhere)->getCounts();
		$oPage=Page::RUN($nTotal,15,Jiaju_Extend::getCasepageUrl($arrJiajucompany,false));
		$arrCases=Model::F_('jiajucase')
			->setColumns('jiajucase_id,jiajucase_pics,jiajucase_title,create_dateline,jiajucase_thumb,jiajucase_picnum,jiajucase_likenum,jiajucase_commentnum')
			->where($arrWhere)
			->order('jiajucase_id DESC')
			->limit($oPage->S(),$oPage->N())
			->getAll();

		$this->assign('arrCases',$arrCases);
		$this->assign('nTotalCase',$nTotal);
		$this->assign('sPageNavbar',$oPage->P(array('id'=>'pagination','style'=>'li','current'=>'active')));
		$this->display(Jiaju_Extend::getTemplate($arrJiajucompany,'case'));
	}

}
